export default {
	namespaced: true, // 具名导出
	state: {
		addressList: sessionStorage.getItem("addressList")
			? JSON.parse(sessionStorage.getItem("addressList"))
			: [],
		chosenAddressId: sessionStorage.getItem("chosenAddressId") || "1",
	},
	mutations: {
		setAddressList(state, data) {
			state.addressList = data;
			sessionStorage.setItem("addressList", JSON.stringify(data));
		},
		setChosenAddressId(state, data) {
			state.chosenAddressId = data;
			sessionStorage.setItem("chosenAddressId", data);
		},
	},
	actions: {},
};

// namespaced: true
// this.$store.state.模块名.xxx
// this.$store.commit('模块名/xxx')
// this.$store.dispatch('模块名/xxx')
// ...mapState('模块名', ['xxx'])
// ...mapMutation('模块名', ['xxx'])
// ...mapAction('模块名', ['xxx'])

// namespaced: false
// this.$store.state.xxx
// this.$store.commit(/xxx')
// this.$store.dispatch(/xxx')
// ...mapState(['xxx'])
// ...mapMutation(['xxx'])
// ...mapAction(['xxx'])
